package com.ftn;

import java.awt.*;

/**
 * User: Jack Fu
 * Date: 2024/9/4
 * Time: 16:41
 * To change this template use File | Settings | File Templates.
 * Description:
 */
public class GameObj {
    public int x;
    public int y;
    public int width;
    public int height;
    public Image image;
    public int speed;
    public GameWin gameWin;

    public void paintSelf(Graphics g) {
        g.drawImage(image, x, y, null);
    }

    // 用来碰撞检测
    public Rectangle getRec() {
        return new Rectangle(x, y, width, height);
    }

    public GameObj() {
    }

    public GameObj(int x, int y) {
        this.x = x;
        this.y = y;
    }

    public GameObj(int x, int y, int width, int height, Image image, int speed, GameWin gameWin) {
        this.x = x;
        this.y = y;
        this.width = width;
        this.height = height;
        this.image = image;
        this.speed = speed;
        this.gameWin = gameWin;
    }

    public GameObj(int x, int y, Image image, int speed) {
        this.x = x;
        this.y = y;
        this.image = image;
        this.speed = speed;
    }

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public int getHeight() {
        return height;
    }

    public void setHeight(int height) {
        this.height = height;
    }

    public Image getImage() {
        return image;
    }

    public void setImage(Image image) {
        this.image = image;
    }

    public int getSpeed() {
        return speed;
    }

    public void setSpeed(int speed) {
        this.speed = speed;
    }

    public GameWin getGameWin() {
        return gameWin;
    }

    public void setGameWin(GameWin gameWin) {
        this.gameWin = gameWin;
    }

}
